#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int factorial(int n);

int main()
{
	int n = 1;
	printf("input n:");
	scanf("%d", &n);
	int re;
	re = factorial(n);
	printf("result:%d\n", re);
	return 0;
}

int factorial(int n)
{
	int i;
	int re = 1;
	for(i = 1; i <= n; i++)re = re * i;
	return re;
}
